#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{

	int mood_index[24] = { 0 };
	for (int i = 0; i < 24; i++)
	{
		scanf("%d", &mood_index[i]);
	}

	int time = 0;
	while (1)
	{
		scanf("%d", &time);
		if (time < 0 || time > 23)
		{
			break;
		}
		if (mood_index[time] > 50)
		{
			printf("%d Yes\n", mood_index[time]);
		}
		else
		{
			printf("%d No\n", mood_index[time]);
		}
	}


	return 0;
}
